import request from '@/utils/request';
import downloader from '@/utils/downloader';

//查询
export function studentList(data) {
  return request({
    url: '/admin/user/student/studentList',
    method: 'get',
    params: data,
  });
}

//新增
export function addStudent(data) {
  return request({
    url: '/admin/user/student/addStudent',
    method: 'post',
    data,
  });
}

//修改
export function updateStudent(data) {
  return request({
    url: '/admin/user/student/updateStudent',
    method: 'post',
    data,
  });
}

//删除
export function removeStudent(data) {
  return request({
    url: '/admin/user/student/removeStudent',
    method: 'post',
    params: data,
  });
}

//重置学生密码
export function resetPassword(data) {
  return request({
    url: '/admin/user/student/resetPassword',
    method: 'post',
    params: data,
  });
}

//导入
export function importStudent(data) {
  return request({
    url: '/admin/user/student/importStudent',
    method: 'post',
    data,
  });
}

//导出
export function studentExport(data) {
  return downloader({
    url: '/admin/user/student/studentExport',
    method: 'get',
    params: data,
  });
}

//修改密码
export function updatePassword(data) {
  return request({
    url: '/admin/user/student/updatePassword',
    method: 'post',
    params: data,
  });
}

//下载模板
export function downloadTemplate(data) {
  return downloader({
    url: '/admin/user/student/downloadTemplate',
    method: 'get',
    params: data,
  });
}

//用户解锁-可批量
export function unlockStudentBatch(data) {
  return request({
    url: '/admin/user/student/unlockStudentBatch',
    method: 'post',
    params: data,
  });
}

//学生信息
export function studentInfo(data) {
  return request({
    url: '/admin/user/student/studentInfo',
    method: 'get',
    params: data,
  });
}

//修改头像
export function updateHeadPortrait(data) {
  return request({
    url: '/admin/user/student/updateHeadPortrait',
    method: 'post',
    params: data,
  });
}

//学生注册
export function registerStudent(data) {
  return request({
    url: '/admin/user/student/registerStudent',
    method: 'post',
    data,
  });
}
